<template>
	<!-- 核销订单 -->
	<view class="exchangeorderr_wp">
		<view class="e_list">
			<!-- <view class="e_item" v-for="(item,idx) in list" :key="item.id" @click="$navTo('../order/detailsw?id='+item.id+'&status=1')"> -->
			<view class="e_item" v-for="(item,idx) in list" :key="item.id">
				<view class="e_itee_head">
					<view class="flex_box">订单编号：{{item.ordersn}}<image style="width: 38rpx;margin-left: 10rpx;" @click="copyRemark(item.ordersn)" src="/static/copy.png" mode="widthFix"></image></view>
					<view>{{item.statusName}}</view>
				</view>
				<view class="e_itee_body">
					<image :src="item.goodsList[0].thumb" mode=""></image>
					<view class="e_itee_name">
						<view class="e_itee_title clamp">{{item.goodsList[0].goodstitle}}</view>
						<view>数量：{{item.goodsList[0].total}}</view>
						<view>售价：{{item.goodsList[0].realprice}}</view>
						<view>用户实付：<text class="pub_red">{{item.price}}</text></view>
						<view v-if="item.status == '1'">预估实收金额：{{item.costprice}}</view>
						<view v-if="item.status == '3'">实收金额：{{item.costprice}}</view>
					</view>
				</view>
				<view class="time flex_align_center">
					<view>购买人：{{item.nickname}}</view>
				</view>
				<view class="time flex_align_center" v-if="item.mobile!=''||item.mobile!==null||item.mobile!==undefined">
					<view>购买人电话：{{item.mobile}}</view>
					<uni-icons type="phone" size="18" @click="phone(item.mobile)"></uni-icons>
				</view>
				<view class="time">
					<view>支付时间：{{item.paytime}}</view>
					<view v-if="item.status=='3'">核销时间：{{item.checktime}}</view>
					<view v-if="item.status=='-1'">退款时间：{{item.refundtime}}</view>
				</view>
				<view class="time flex_align_center" v-if="item.remark!==null">
					<view class="flex1">备注信息：{{item.remark}}</view>
					<image style="width: 38rpx;margin-left: 10rpx;" @click="copyRemark(item.remark)" src="/static/copy.png" mode="widthFix"></image>
				</view>
				<view class="flex_end">
					<view class="e_itee_btn" v-if="item.opencheck==1" @click="check(item.id)">核销</view>
					<view class="e_itee_btn" v-if="item.opencz==1" @click="chongzhi(item.id)">充值</view>
					<view class="e_itee_btn e_itee_btn2" v-if="item.opencheck==1||item.opencx==1" @click="tuikuan(item.id)">退款</view>
				</view>
			</view>
		</view>
		<view class="loading_message">
			<image v-show="isloading" src="@/static/business/loading.gif" mode=""></image>
			<text v-show="!ismore">到底了~</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'myorder',
		props: {
			list: {
				type: Array,
				default: () => []
			},
			isloading: {
				type: Boolean,
				default: false
			},
			ismore: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {
				active: 1,
			}
		},
		methods: {
			check(id){
				this.$axios('order/dh','POST','supplier',{
					id
				}).then(res=>{
					if(res.data.code == 200){
						this.$api.msg(res.data.data);
					}
				})
			},
			chongzhi(id){
				this.$axios('order/prepaid','POST','supplier',{
					id
				}).then(res=>{
					if(res.data.code == 200){
						this.$api.msg(res.data.data);
					}
				})
			},
			tuikuan(id){
				this.$axios('order/refundTg','POST','supplier',{
					id
				}).then(res=>{
					if(res.data.code == 200){
						this.$api.msg(res.data.data);
					}
				})
			},
			copyRemark(data){
				uni.setClipboardData({
					data: data
				})
			},
			phone(v){
				uni.makePhoneCall({
					phoneNumber: v
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #f2f2f2;
		color: $font-color-dark;
		padding-bottom: 130upx;
	}

	.e_nav {
		background-color: #fff;
		display: flex;
		align-items: center;
		line-height: 100upx;
		position: fixed;
		width: 100%;
		z-index: 100;
	}

	.e_nav view {
		flex: 1;
		text-align: center;
		font-size: $font-base;
		position: relative;
	}

	.e_nav_active:after {
		content: '';
		border-bottom: 3px $base-color solid;
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		bottom: 20upx;
		width: 40upx;
	}

	.e_list {
		overflow: hidden;
	}

	.e_item {
		background-color: #fff;
		border-radius: 10upx;
		margin: 20upx 20upx 0;
		padding: 20upx;

	}
	.e_itee_btn{
		width: 150rpx;
		line-height: 52rpx;
		background: #8615E1;
		border-radius: 33rpx;
		color: #FFFFFF;
		font-size: 26rpx;
		text-align: center;
		margin-top: 10rpx;
		margin-left: 20rpx;
	}
	.e_itee_btn2{
		background: #F1E0FD;
		color: #8615E1;
	}
	.e_itee_head {
		border-bottom: 1px #DCDFE6 solid;
		padding-bottom: 20upx;
	}

	.e_itee_head,
	.e_itee_body {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.e_itee_head view:nth-of-type(2) {
		color: red;
	}

	.e_itee_body {
		border-bottom: 1px hsl(0, 0%, 87%) solid;
		align-items: flex-start;
		padding: 20upx 0;
	}

	.e_itee_body image {
		border-radius: 10upx;
		width: 140upx;
		height: 140upx;
	}

	.e_itee_name {
		color: #666;
		width: calc(100% - 140upx);
		font-size: 28upx;
		padding-left: 20upx;
	}

	.e_itee_title {
		font-size: 30upx;
		color: #000;
	}

	.e_itee_money {
		color: #666;
		padding: 30upx 0;
		text-align: right;

		.color_1 {
			color: #000;
			font-weight: bold;
		}
	}
	
	.time {
		color: #444;
		font-size: 28upx;
		padding-left: 20upx;
		border-bottom: 1px hsl(0, 0%, 87%) solid;
	}

	.e_buttons {
		text-align: right;
		padding-top: 20upx;
	}

	.e_buttons text {
		border: 1px hsl(0, 0%, 87%) solid;
		border-radius: 40upx;
		display: inline-block;
		line-height: 60upx;
		margin-left: 20upx;
		text-align: center;
		width: 190upx;
	}

	.e_buttons .e_pay {
		border-color: $base-color;
		color: $base-color;
	}

	.loading_message {
		color: #0062CC;
		padding: 20upx;
		text-align: center;
	}

	.loading_message image {
		height: 50upx;
		width: 50upx;
	}
</style>